import http from '@/plugins/axios'
// 登录获取验证码
let postLoginCode = (data) => http.post('/code/login', data)
// 登录
let postLogin = (data) => http.post('/match/auth/login', data)
// 注册获取验证码
let postRegisterCode = (data) => http.post('/code/register', data)
// 注册
let postRegister = (data) => http.post('/match/auth/register', data)
// 获取用户信息及资源
let getInfo = () => http.get('/user/info')
// 获取验证的配置参数
let getConfig = () => http.get('/gt/register?t=' + (new Date()).getTime())
// 获取验证的配置参数
let getValidate = (data) => http({
  url: '/gt/ajax-validate',
  method: 'post',
  params: data
})
// 查看企业详情，未登录状态
let withoutDetail = (id) => http.get('/match/enterprise/noToken/' + id)
// 查看企业详情，登录状态
let withDetail = (id) => http.get('/match/enterprise/' + id)
export default {
  postLoginCode,
  postLogin,
  postRegisterCode,
  postRegister,
  getInfo,
  getConfig,
  getValidate,
  withoutDetail,
  withDetail
}
